/**
 * 异步操作
 * @param commit
 */

export const appSetShowList = ({ commit }) => {
  commit('APP_SET_SHOW_LIST')
}

export const appSetShowMap = ({ commit }) => {
  commit('APP_SET_SHOW_MAP')
}

export const amapLoaded = ({ commit }) => {
  commit('AMAP_LOADED')
}

export const amapNeedRefresh = ({ commit }) => {
  commit('AMAP_NEED_REFRESH')
}

export const amapRefreshCompleted = ({ commit }) => {
  commit('AMAP_REFRESH_COMPLETED')
}

export const amapSetCurrentCity = ({ commit }, cityData) => {
  commit('AMAP_SET_CURRENT_CITY', cityData)
}

export const amapSetNewCity = ({ commit }, cityData) => {
  commit('AMAP_SET_NEW_CITY', cityData)
}

export const amapSetCurrentPosition = ({ commit }, position) => {
  commit('AMAP_SET_CURRENT_POSITION', position)
}

export const amapSetZoom = ({ commit }, zoom) => {
  commit('AMAP_SET_ZOOM', zoom)
}

export const amapSetMapCenter = ({ commit }, center) => {
  commit('AMAP_SET_MAP_CENTER', center)
}

export const amapSetLocationSearchKeyword = ({ commit }, keyword) => {
  commit('AMAP_SET_LOCATION_SEARCH_KEYWORD', keyword)
}

export const amapSetLocationSearchResults = ({ commit }, results) => {
  commit('AMAP_SET_LOCATION_SEARCH_RESULTS', results)
}

export const amapSetPoiSearchResults = ({ commit }, results) => {
  commit('AMAP_SET_POI_SEARCH_RESULTS', results)
}

export const amapSetDistrictSearchResults = ({ commit }, results) => {
  commit('AMAP_SET_DISTRICT_SEARCH_RESULTS', results)
}

export const amapSetDistrictCountResults = ({ commit }, results) => {
  commit('AMAP_SET_DISTRICT_COUNT_RESULTS', results)
}

export const amapSetLocationId = ({ commit }, id) => {
  commit('AMAP_SET_LOCATION_ID', id)
}

export const amapSetLocationName = ({ commit }, name) => {
  commit('AMAP_SET_LOCATION_NAME', name)
}
